import request from '@/utils/request'
// import qs from 'qs'
/**
 * 楼盘签约详情
 * 新增 编辑 查询
 * @param {*} data id method
 * @returns
 */
export function signingRealEstate(data, id, method) {
  let url = `/api/v1/signingRealEstate/${id}`
  if (data) {
    url = '/api/v1/signingRealEstate'
  }
  return request({
    url: url,
    method: method || 'POST',
    data
  })
}

/**
 * 根据客户编码获取办事处客户经理等信息
 * @param {*} customerCode
 * @returns
 */
export const getSigningRealEstateCustomer = async(customerCode) => {
  const res = await request({
    url: `/api/v1/signingRealEstate/getSigningRealEstateCustomer/${customerCode}`,
    method: 'get'
  })
  return res && res.data
}

// 根据ID查询样板间详情
export const modelRoomInfo = async(id) => {
  const res = await request({
    url: `/api/v1/modelRoomInfo/${id}`,
    method: 'get'
  })
  return res && res.data
}
// 修改
export const putModelRoomInfo = async(data) => {
  const res = await request({
    url: `/api/v1/modelRoomInfo`,
    method: 'put',
    data: data
  })
  return res
}

// 维护订单信息
export const orderMaintain = async(data) => {
  const res = await request({
    url: `/api/v1/modelRoomInfo/orderMaintain`,
    method: 'post',
    data
  })
  return res
}

// 执行返利
export const executeRebate = async(data) => {
  const res = await request({
    url: `/api/v1/modelRoomInfo/executeRebate`,
    method: 'post',
    data
  })
  return res
}


// 查询所有系列
export const configSeries = async(data) => {
  const res = await request({
    url: `/api/v1/configSeries/`,
    method: 'get',
    data
  })
  return res
}

